﻿package java_45;

import java.util.ArrayList;
import java.util.List;

public class Test {
	public static void main(String[] args) {
		Dog ouoDog=new Dog("欧欧","雪瑞那");
		Dog yayaDog = new Dog("亚亚","拉布拉多");
		Dog meimeiDog=new Dog("美美","雪瑞那");
		Dog fefeiDog=new Dog("菲菲","雪瑞那");
		List dogs = new ArrayList();
		dogs.add(ououDog);
		dogs.add(yayaDog);
		dogs.add(meimeiDog);
		dogs.add(2,feifeiDog);
		
		System.out.println("共计有" + dogs.size() + "条狗狗");
		System.out.println("分别是:");
		for(int i =0;i<dogs.size();i++){
			Dog dog=(Dog)dogs.get(i);
			System.out.println(dog.getName() + "\t"
			+ dog.getStrain());
		}
	}
}
